package pw.hais.main.main_app.app;

import android.os.Bundle;
import android.view.MenuItem;

import com.avos.avoscloud.AVAnalytics;

import pw.hais.app.AppBaseActivity;

/**
 * Created by hais1992 on 2015/12/13.
 */
public class BaseActivity extends AppBaseActivity {
    protected HaisApplication app;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);

        getSupportActionBar().setDisplayHomeAsUpEnabled(true);
        app = (HaisApplication) getApplication();
    }

    @Override
    public boolean onOptionsItemSelected(MenuItem item) {
        switch (item.getItemId()) {
            case android.R.id.home:
                finish();
                break;
        }
        return super.onOptionsItemSelected(item);
    }

    @Override
    protected void onPause() {
        super.onPause();
        AVAnalytics.onPause(this);
    }

    @Override
    protected void onResume() {
        super.onResume();
        AVAnalytics.onResume(this);
    }
}
